package com.mybatisflex.test.dictionary;

import com.alibaba.fastjson2.JSON;
import com.mybatisflex.annotation.Dictionary;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Getter;
import lombok.Setter;

/**
 * 字典测试类
 *
 * @author zhang
 */
@Getter
@Setter
@Table(value = "tb_student")
public class Student {

    /**
     * 主键
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 性别
     */
    @Dictionary(mainCd = "ST001")
    private Integer sex;

    /**
     * 班级
     */
    @Dictionary(mainCd = "ST002")
    private String classCd;

    /**
     * 是否删除
     */
    private Boolean isDelete;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
